<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //一年中的第几天
    var year = 2024;
    var mon = 1;
    var day = 20;
    var days = 0;
    switch (mon) {
        case 12 :
            days += 30;
        case 11 :
            days += 31;
        case 10 :
            days += 30;
        case 9 :
            days += 31;
        case 8 :
            days += 31;
        case 7 :
            days += 30;
        case 6 :
            days += 31;
        case 5 :
            days += 30;
        case 4 :
            days += 31;
        case 3 :
            if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
                days += 29;
            } else {
                days += 28;
            }
        case 2 :
            days += 31;
    }
    days += day;
    document.write(year + '年' + mon + '月' + day + '日是' + year + '年的第' + days + '天')
</script>
</body>
</html>